import React, { Component } from 'react'
import { withRouter } from 'react-router-dom'
import { getMsg } from '../../redux/actionCreator'
import './avatar.css'

class Avatar extends Component {
    constructor(props) {
        super(props)
    }
    render() {
        const { name, pic } = this.props
        return (
            <div

                className="avatar"
                style={{ height: '13em', width: '100%' }}>

                {/* 昵称 */}
                <div
                    onClick={() => this.props.history.push('/accountman')}
                    className="avatar-name"
                >
                    {name}
                    {/* <i className="iconfont icon-bi"></i> */}
                </div>

                {/* 头像 */}
                <div
                    className="avatar-circle"
                    onClick={() => this.props.history.push('/accountman')}
                >
                    {/* 头像 */}
                    <img className="avatar-img" src={pic}></img>

                    {/* 个性签名 */}
                    <div className="avatar-sign">
                        {getMsg(this.props).user_sign}
                        {/* <i className="iconfont icon-bi"></i> */}
                    </div>
                </div>

            </div>
        )
    }
}

export default withRouter(Avatar);
